package com.jt.pojo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author 张琪
 * @date 2020/11/24
 * @describe 属性依赖注入需要set/get方法的支持
 */

@Component
@Setter
@Getter
@ConfigurationProperties(prefix = "user")
public class User {
//    @Value("${user.id}")
    private Integer id;
//    @Value("${user.username}")
    private String username;
//    @Value("${user.age}")
    private Integer age;
//    @Value("${user.sex}")
    private String sex;
}
